package com.spring.quickstart.controller.demo;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class ComponentAction {

	//http://127.0.0.1:8080/demo/showComponent.htm?userName=xiongxin&dealDate=20171231
	@RequestMapping("/demo/showComponent")
	public void showComponent(HttpServletRequest request, ModelMap model, @RequestParam("userName") String userName, long dealDate) throws Exception {
		model.addAttribute("dealDate", dealDate);
		model.addAttribute("userName", userName);

		//link组件
		model.addAttribute("url", "http://www.hundsun.com");
		model.addAttribute("text", "恒生电子股份有限公司");
	}
}
